package com.buer.train.business.service.impl;

import com.buer.train.business.dao.CertificateDao;
import com.buer.train.business.domain.CertificateDO;
import com.buer.train.business.service.CertificateService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class CertificateServiceImpl implements CertificateService {
	@Autowired
	private CertificateDao certificateDao;
	
	@Override
	public CertificateDO get(Integer id){
		return certificateDao.get(id);
	}
	
	@Override
	public List<CertificateDO> list(Map<String, Object> map){
		return certificateDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return certificateDao.count(map);
	}
	
	@Override
	public int save(CertificateDO certificate){
		return certificateDao.save(certificate);
	}
	
	@Override
	public int update(CertificateDO certificate){
		return certificateDao.update(certificate);
	}
	
	@Override
	public int remove(Integer id){
		return certificateDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return certificateDao.batchRemove(ids);
	}

    @Override
    public PageInfo<CertificateDO> getCertificateList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<CertificateDO> list = certificateDao.getCertificateList(map); // 获取数据
        PageInfo<CertificateDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public CertificateDO getOne(Map<String, Object> map){
        return certificateDao.getOne(map);
    }
	
}
